package priv.menguer.filter.service.impl;

import java.util.List;

import priv.menguer.filter.controller.Person;
import priv.menguer.filter.service.Criteria;

/**
 * @Title AndCriteria.java
 * @description TODO
 * @time 2018年10月26日 上午9:56:26
 * @author menguer@126.com
 * @version 1.0
 */
public class AndCriteria implements Criteria {

	private Criteria criteria;
	private Criteria otherCriteria;

	public AndCriteria(Criteria criteria, Criteria otherCriteria) {
		this.criteria = criteria;
		this.otherCriteria = otherCriteria;
	}

	@Override
	public List<Person> meetCriteria(List<Person> persons) {
		List<Person> firstCriteriaPersons = criteria.meetCriteria(persons);
		return otherCriteria.meetCriteria(firstCriteriaPersons);
	}
}
